package factory.simplefactory;

//一个抽象的图形类，其他图像都继承该类
public abstract class Graphical {
    public String name;
    public void draw(){
        System.out.println("我是:"+this.name);
    }
    public void erase(){
        System.out.println(this.name+"被擦除了");
    }
}

//圆形
class Crcular extends Graphical{
    public Crcular(){
        super.name="圆形";
    }
}
//方形
class Square extends  Graphical{
    public Square(){
        super.name="方形";
    }
}
//三角形
class Triangle extends Graphical{
    public Triangle(){
        super.name="三角形";
    }
}

